<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\Enclosure */

$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Enclosures', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="enclosure-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('更新', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('删除', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => '您确定删除本附件?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'xa_article_id',
            'xa_type',
            //'xa_name',
            [
              'attribute'=>'xa_name',
                'format'=>'raw',
                 'value'=>function($model)
                {
                    return Html::img($model->xa_name,['height'=>'100px']);

                }

            ],
            'xa_title',
            'xa_abstract',
            'xa_create_time',
            'xa_update_time',
            'xa_remark',
        ],
    ]) ?>

</div>
